package cn.bdqn.wen.controller;

import cn.bdqn.wen.pojo.Categroy;
import cn.bdqn.wen.pojo.Detail;
import cn.bdqn.wen.service.Detailservice;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class Detailcontroller {
    @Resource
    private Detailservice ds;
   @RequestMapping("/index")
   @ResponseBody
    public List<Detail> selectDetail(int categroyId,String title ){
       return ds.selectDetail(categroyId,title);
   }
    @RequestMapping("/index")
    @ResponseBody
    public  List<Categroy>  selectDetail(){
       return  ds.selectCategroy();
    }
    @RequestMapping("/update")
    @ResponseBody
    public  int upate(Detail detail){
     return  ds.updateDetail(detail);
    }
    @RequestMapping("/index")
    @ResponseBody
    public  List<Detail> selectId(int id){
       return  ds.selectId(id);
    }
}
